package cn.maihe.elg.operation.centers.quanzhou.exception;

import cn.maihe.elg.operation.centers.quanzhou.enums.QuanzhouRespCodeEnum;
import lombok.Getter;

/**
 * @Description 泉州中心异常类
 * @Author xxx
 * @Date 2025/08/31
 */
@Getter
public class QuanzhouException extends RuntimeException {
    
    private QuanzhouRespCodeEnum statusEnum;
    
    public QuanzhouException(QuanzhouRespCodeEnum statusEnum) {
        super(statusEnum.getDesc());
        this.statusEnum = statusEnum;
    }
    
    public QuanzhouException(QuanzhouRespCodeEnum statusEnum, String message) {
        super(message);
        this.statusEnum = statusEnum;
    }
    
    public QuanzhouException(QuanzhouRespCodeEnum statusEnum, String message, Throwable cause) {
        super(message, cause);
        this.statusEnum = statusEnum;
    }
    
    public static QuanzhouException of(QuanzhouRespCodeEnum statusEnum) {
        return new QuanzhouException(statusEnum);
    }
    
    public static QuanzhouException of(QuanzhouRespCodeEnum statusEnum, String message) {
        return new QuanzhouException(statusEnum, message);
    }
    
    public static QuanzhouException of(QuanzhouRespCodeEnum statusEnum, String message, Throwable cause) {
        return new QuanzhouException(statusEnum, message, cause);
    }
    
    /**
     * 获取状态枚举
     * @return 状态枚举
     */
    public QuanzhouRespCodeEnum getStatus() {
        return this.statusEnum;
    }
}